
package statcomponent;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * 统计属性管理
 *
 * @author chenfoxin
 * @date 2022年09月01日 9:18
 */
public class StatContext<U> {

    /**
     * 字段统计规则
     */
    private List<StatAttribute> attributes;

    /**
     * 结果对象
     */
    private U resultRecord;

    /**
     * @author chenfoxin
     * @description 构造方法
     * @param resultRecord
     * @param attributes
     * @date: 2023/7/29 15:22
     * @return null
     */
    public StatContext(U resultRecord,StatAttribute... attributes) {
        this.resultRecord = resultRecord;
        this.attributes = new ArrayList<>();
        Collections.addAll(this.attributes,attributes);
    }

    public List<StatAttribute> getAttributes() {
        return attributes;
    }

    public void setAttributes(List<StatAttribute> attributes) {
        this.attributes = attributes;
    }

    public U getResultRecord() {
        return resultRecord;
    }

    public void setResultRecord(U resultRecord) {
        this.resultRecord = resultRecord;
    }
}